<?php


namespace app\xcxapi\controller\v1;

use app\common\controller\XcxController;
use app\xcxapi\service\TimetableService;

class Timetable extends XcxController
{
    /**
     * 课表页面
     * User: wufeng
     * Date: 2020/02/20.
     */
    public function timetableIndex()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new TimetableService($this->type))->timetableIndex($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * 课表列表
     * User: wufeng
     * Date: 2020/02/20.
     */
    public function timetableLists()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new TimetableService($this->type))->signInLists($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }
}
